
module.exports = function (mongoose) {

    var UserSchema = new mongoose.Schema({
        _id:       { type: String, unique: true },
        login:     { type: String, unique: true },
        email:     { type: String, unique: true },
        password:  { type: String },
        phone:     { type: String, required: false },
        name:      { type: String },
        admin:     { type: Boolean }
    });

//name :{
//    first : String,
//    last : String
//},

    var User = mongoose.model('User', UserSchema);

    //put custom methods here

    return {
        User: User
    };
};
